<?php
	require_once 'utils/securityUtils.php';
	require_once 'utils/applicationUtils.php';
	
	session_start();
	
	$_SESSION['eventName'] = "Color Manila Run";
	
	$_SESSION['tokenNumber'] = SecurityUtils::RandNumberToken(10);
	
	$tokenNumber = SecurityUtils::RandNumberToken(8);
	$_SESSION['loginToken'] = sha1($tokenNumber);
	
	$userNameDisplay = "";
	$isLoggedIn = false;
	if(isset($_SESSION['loggedUser']))
	{
		$isLoggedIn = true;
		$_SESSION['userName'] = $_SESSION["loggedUser"]['pi_first_name'];
		$userNameDisplay = "<b>Hello <a href=javascript:gotoNewPage('profile.php')>". $_SESSION['userName'] ."</a> &nbsp;&nbsp;<a href=javascript:gotoNewPage('logout.php')>Logout</a></b> ";
	}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>Color Manila Run - Home</title>
<link rel="stylesheet" href="styles/layout.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="styles/lightbox.css"/>

<script src="scripts/home.js"></script>
<script src="scripts/jquery-1.8.2.js"></script>
<script src="scripts/jquery.md5.js"></script>
<script src="scripts/jquery.sha1.js"></script>
<script src="scripts/textinputUtils.js"></script>
<script src="scripts/preloadercontrol.js"></script>
<script src="scripts/lightbox.js"></script>
<script src="scripts/cyclePlugin.js"></script>
<script src="scripts/commonUtils.js"></script>

</head>
<body marginheight="0" marginwidth="0">
<div id="preloader"><div><img src="images/ajax-loader.gif" width="50" height="50"/></div></div>
<div id="mainContainer">
	<div id="mediaWallpaper">
		<img src="images/cmr_photowall.jpg" height="410px" width="550px"/>
	</div>
	<div id="mediaContainer">
		<div id="containerLeft">
			<div id="header">
				<div id="headerLogo"><!-- img src="images/color_manila_logo_small.png" alt="COLOR MANILA"--></div>
				<!--div id="headerDisplay"-->
				<!-- iframe src="http://player.vimeo.com/video/49740813?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1&amp;loop=1" width="530" height="300" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe-->
					<!-- iframe width="530" height="300" src="https://www.youtube.com/embed/4EERSfHiqT8?feature=player_embedded&rel=0&autoplay=1&loop=1&showinfo=0" frameborder="0" allowfullscreen></iframe-->
				<!-- /div>
				<div id="subLinks">
					<a href="">Schedule of Activities</a> &nbsp; | &nbsp;<a href="">Race Route</a>
				</div-->
			</div>
			
			<div id="contentStaticPhoto">&nbsp;</div>
			
		</div>
		<div id="containerRight">
			<div id="socialNetworkLink">&nbsp;<?php echo $userNameDisplay?></div>
			<div><img alt="PROACTIVE >>" src="images/proactive_logo.png"/></div>
			<div class="divMovieMedia">
				<iframe src="http://player.vimeo.com/video/49740813?title=0&amp;byline=0&amp;portrait=0" width="270" height="170" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
				<!-- OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="270"
		        height="170" codebase='http://www.apple.com/qtactivex/qtplugin.cab'>
		        <param name='src' value="movies/CMRTeaserWLogo.mov">
		        <param name='autoplay' value="true">
		        <param name='controller' value="true">
		        <param name='loop' value="false">
		        <EMBED src="movies/CMRTeaserWLogo.mov" width="270" height="170" autoplay="true" 
		        controller="true" loop="false" pluginspage='http://www.apple.com/quicktime/download/'>
		        </EMBED>
		        </OBJECT-->
			</div>
			<div class="divMovieMedia">
				<iframe src="http://player.vimeo.com/video/50262725?title=0&amp;byline=0&amp;portrait=0" width="270" height="170" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
		    </div>
		    <div class="formItem">
		    	<div style="font-weight: bold;">
		    	<a href="images/schedule_activities.png" rel="lightbox[schedule]" title="Schedule of Activities">Schedule of Activities</a> | 
		    	<a href="images/route1k.png" rel="lightbox[route]" title="Race Route" group>Race Route</a>
		    	<a href="images/route3k.png" rel="lightbox[route]" title="Race Route"></a>
		    	<a href="images/route5k.png" rel="lightbox[route]" title="Race Route"></a>
		    	</div>
		    </div>
			<div id="menuContent">
				<div class="menuButton" onclick="javascript:gotoNewPage('pages/register.php')">
					<div class="menu-buttonBL"></div>
					<div class="menu-buttonM">
					<a href="javascript:gotoNewPage('pages/register.php')" class="menuMain">REGISTER NOW!</a>
					</div>
					<div class="menu-buttonBR"></div>
				</div>
				<div class="divSpacer"></div>
				<?php 
					if(!$isLoggedIn)
					{
				?>
					<div class="divSpacer"></div>
					<div class="menuButton" onclick="javascript:getLoginForm()">
						<div class="menu-buttonBL"></div>
						<div class="menu-buttonM">
						<a href="javascript:getLoginForm()" class="menuMain">LOGIN</a>
						</div>
						<div class="menu-buttonBR"></div>
					</div>
				<?php 
					}
				?>
				<div class="divSpacer"></div>
			</div>
			<div id="loginDisplay"></div>
			<div class="divSpacer"></div>
		</div>
	</div>
	<div id="homeContent">
		<div id="contentDisplay"></div>
		<div id="contentReadMore" class="readMore" ><a href="javascript:contentDisplayText(true)">Read more...</a></div>
	</div>
	<div class="divSpacer"></div>
	<div id="sponsorsContent">
		<div id="sponsors">
			<div id="sponsor1" class="sponsorStyle">
				<img src="images/addidas.png" width="150" height="100" />
				<img src="images/timestudio.png" width="150" height="100" /> 
				<img src="images/puma_time.png" width="150" height="100" /> 
				<img src="images/pascual.png" width="150" height="100" /> 
				<img src="images/kangaroos.png" width="150" height="100" />
				<img src="images/solar_sports.png" width="150" height="100" />
			    <img src="images/century_tuna.png" width="150" height="100" /> 
			    <img src="images/republikha.png" width="150" height="100" />
			</div>
			<div id="sponsor2" class="sponsorStyle">
			    <img src="images/century_tuna.png" width="150" height="100" />
			    <img src="images/solar_sports.png" width="150" height="100" /> 
			    <img src="images/kangaroos.png" width="150" height="100" /> 
			    <img src="images/timestudio.png" width="150" height="100" /> 
			    <img src="images/puma_time.png" width="150" height="100" />
			    <img src="images/republikha.png" width="150" height="100" />
			    <img src="images/addidas.png" width="150" height="100" /> 
			    <img src="images/pascual.png" width="150" height="100" /> 
			</div>
			<div id="sponsor3" class="sponsorStyle">
			    <img src="images/kangaroos.png" width="150" height="100" /> 
			    <img src="images/addidas.png" width="150" height="100" /> 
			    <img src="images/century_tuna.png" width="150" height="100" /> 
			    <img src="images/solar_sports.png" width="150" height="100" />
			    <img src="images/republikha.png" width="150" height="100" />
			    <img src="images/pascual.png" width="150" height="100" />
			    <img src="images/timestudio.png" width="150" height="100" /> 
			    <img src="images/puma_time.png" width="150" height="100" /> 
			</div>
			<div id="sponsor4" class="sponsorStyle">
				<img src="images/puma_time.png" width="150" height="100" /> 
			    <img src="images/century_tuna.png" width="150" height="100" />
			    <img src="images/timestudio.png" width="150" height="100" /> 
			    <img src="images/kangaroos.png" width="150" height="100" /> 
			    <img src="images/pascual.png" width="150" height="100" />
			    <img src="images/addidas.png" width="150" height="100" />
			    <img src="images/republikha.png" width="150" height="100" />
			    <img src="images/solar_sports.png" width="150" height="100" />
			</div>
			<div id="sponsor5" class="sponsorStyle">
			    <img src="images/solar_sports.png" width="150" height="100" />
			    <img src="images/republikha.png" width="150" height="100" />
			    <img src="images/pascual.png" width="150" height="100" /> 
			    <img src="images/addidas.png" width="150" height="100" />
			    <img src="images/century_tuna.png" width="150" height="100" />  
			    <img src="images/timestudio.png" width="150" height="100" /> 
			    <img src="images/puma_time.png" width="150" height="100" />
			    <img src="images/kangaroos.png" width="150" height="100" /> 
			</div>
		</div>
	</div>
	<div class="divSpacer"></div>
	<?php include 'footer.php'; ?>
</div>

</body>
<script>

$("#loginDisplay").hide();
$("#preloader").css({ opacity: 0.5 });
contentDisplayText(false);

$('#sponsor1').cycle('fade');
$('#sponsor2').cycle('fade');
$('#sponsor3').cycle('fade');
$('#sponsor4').cycle('fade');
$('#sponsor5').cycle('fade');

/*
$("#loginDisplay").click(function()
{
	$("input[name=username]").blur(function(e){
		validateEmailAddress(e, $("#emailErrorMsg"));
	});
});
*/

</script>
</html>